
package body EventHandler is

   task body Event_Handler is
      -- Declarations, including D of type Data

      D : Data := 0;
      package X_IO is new Ada.Text_IO.Integer_IO(Positive);
      use X_IO;

   begin
      -- Initialization code

      Ada.Text_IO.Put_Line("Activacao do Event Handler...");

      loop

         Ada.Text_IO.Put_Line("A Task vai tentar aceder ao PO...");

         ProtectedEntry.Event_Object.Wait(D);

         Ada.Text_IO.Put_Line("A Task encontra-se suspensa na barreira...");


         -- Non-suspending event handling code

      end loop;
   end Event_Handler;

end EventHandler;
